package com.spc.car.data.service.std.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.spc.car.common.utils.StringUtils;
import com.spc.car.data.entity.std.StdGbProfessionalTechnicalPosition;
import com.spc.car.data.mapper.std.StdGbProfessionalTechnicalPositionMapper;
import com.spc.car.data.service.std.StdGbProfessionalTechnicalPositionService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 专业技术职务代码
GB/T 8561-2001 服务实现类
 * </p>
 *
 * @author 
 * @since 2020-04-01
 */
@Service
public class StdGbProfessionalTechnicalPositionServiceImpl extends ServiceImpl<StdGbProfessionalTechnicalPositionMapper, StdGbProfessionalTechnicalPosition> implements StdGbProfessionalTechnicalPositionService {

    @Override
    public List<StdGbProfessionalTechnicalPosition> listStdGbProfessionalTechnical(String parentCode) {
        return list(new LambdaQueryWrapper<StdGbProfessionalTechnicalPosition>()
                .eq(StringUtils.isNotBlank(parentCode),StdGbProfessionalTechnicalPosition::getParentCode, parentCode)
                .isNull(StringUtils.isBlank(parentCode),StdGbProfessionalTechnicalPosition::getParentCode)
                .orderByAsc(StdGbProfessionalTechnicalPosition::getCode)
        );
    }
}
